<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <base href="<%=basePath%>" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>个人信息管理系统——创建用户</title>
	
	<link rel="stylesheet" type="text/css" href="css/accountCreate.css" />
	<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="js/jquery.validate.min.js"></script>
	<script type="text/javascript">
		$(function(){
			
			$("#createAccountform").validate({
				rules: {
					username: {
						required: true,
						minlength: 4	
					},
					password: {
						required: true,
						minlength: 6
					},
					repassword: {
						required: true,
						minlength: 6,
						equalTo: "#password"
					},
					email: {
						required: true,
						email: true
					}
				},
				messages: {
					username: {
						required: "请输入用户名",
						minlength: "用户名不少4字符"
					},	
					password: {
						required: "请输入密码",
						minlength: "密码最少6个字符，最长不得超过14个字符"
					},
					repassword: {
						required: "请输入密码",
						minlength: "密码最少6个字符，最长不得超过14个字符",
						equalTo: "密码与确认密码不一致"
					},
					email: "请输入正确的邮箱地址"				
				}
			});
			
			$("#createAccountbutton").click(function(){
				$("#usernamev").val($("#username").val());
				$("#passwordv").val($("#password").val());
				$("#emailv").val($("#email").val());
				$("#createAccountform").submit();			
			});
		});
	</script>
		
</head>
  
<body>
	<h1 id="banner">banner</h1>
	<div id="errormsg"><s:property value="msg"/></div>
	<div id="createAccount">
	    <form id="createAccountform" method="post" action="accountCreate">
		    <input type="hidden" id="usernamev" name="account.username" />
		    <input type="hidden" id="passwordv" name="account.password" />
		    <input type="hidden" id="emailv" name="account.email" />
	    	<p><span>用户名:　 </span><input type="text" id="username" name="username" /></p>
	    	<p><span>密码:　 　</span><input type="password" id="password" name="password" /></p>
	        <p><span>重复密码: </span><input type="password" id="repassword" name="repassword" /></p>
	        <p><span>电子邮箱: </span><input type="text" id="email" name="email" /></p>
	        <div id="createAccountbutton"></div>
	    </form>
	</div>
</body>
</html>
